<template>
	<view class="task-position-app">

		<view class="weather-date-head" >
			<view class="field-item">
				<view class="tit">旧密码：</view>
				<view class="content">
					<input type="password" class="input" v-model="item.oldPassword" />
				</view>
			</view>
			<view class="field-item">
				<view class="tit">新密码：</view>
				<view class="content">
					<input type="password" class="input" v-model="item.newPassword" />
				</view>
			</view>
		</view>
		
		<view class="buttons">
			<view class="submit-button" @click="submit">确定提交</view>
		</view>
		
	</view>
</template>

<script>
	
	import util from '@/libs/util.js'
	import globalConfig from 'config'

	export default {
		data() {
			return {
				loading: false,
				title: '修改密码',
				item: {
					oldPassword: "",
					newPassword: "",
				}
			}
		},
		onLoad(params) {

		},
		components: {

		},
		computed: {
			
		},
		methods: {
			...util,
			
			submit() {
				let url = "";
				this.$api.post('/account/changePsw',
					{
					  newPsw: this.item.newPassword,
					  oldPsw: this.item.oldPassword
					},
				).then((response) => {
					/*
					this.item = response.data
					this.loading = false
					uni.hideLoading()
					*/
				   if (response.ret===1) {
					   this.$Message.success('提交成功');
					   //跳转回首页
					   setTimeout(() => {
						   uni.navigateBack({
								delta: 1
						   });
					   }, 2000);
				   } else {
					   this.$Message.error(response.msg);
				   }
				});
			},
			
			goPage(url) {
				uni.navigateTo({
					url: url
				})
			}
		}
	}
</script>


<style lang="scss">
	page{
		height:100%;
	}
	.task-position-app{
		background-color: #F5F4F8;
		height:100%;
		.app-info-dialog{
			display:flex;
			justify-content: center;
			align-items: center;
		}
		.weather-date-head{
			margin-top:20upx;
			background-color: white;
			padding:20upx;
			.field-item{
				margin:20upx 0;
				display: flex;
				.tit{
					width:150upx;
				} 
				.content{
					flex:1;
				}
			}
			.input{
				border: 1upx solid #eee;
				width:500upx;
				padding:15upx;
				margin-top:-10upx;
			}
			.title{
				font-weight: bold;
			}
			.tool{
				display: flex;
				margin-top:10upx;
				.tit{width:120upx;}
				.content{}
			}
		}
		.head{
			background-color: white;
			padding:20upx;
			.title{
				font-weight: bold;
			}
			.tool{
				display: flex;
				margin-top:10upx;
				.tit{width:120upx;}
				.content{}
			}
		}
		.body-items{
			width:100%;
			padding-bottom: 200upx;
		}
		.body-item{
			background-color: white;
			padding:20upx;
			margin-top:20upx;
			.title{
				font-weight: bold;
			}
			.info{
				font-size:28upx;
				margin:20upx 0;
			}
			.photo-part{
				margin-bottom: 20upx;
				.title{
					
				}
				.photos{
					display: flex;
					.photo{
						
					}
					.photo-items{
						display: flex;
						margin-top:20upx;
						.photo-item{
							margin-right:20upx;
							image{
								width:100upx;
								height:100upx;
							}
						}
					}
				}
				.photo-add{
					margin-top:20upx;
				}
				.info{
					
				}
				.content{
					.textarea{
						width:100%;
						border: 1upx solid #eee;
					}
				}

			}
		}
		.buttons{
			position: fixed;
			z-index: 100;
			bottom:0;
			width:100%;
			background-color: white;
			border-top:1upx solid #eee;
			.submit-button{
				background-color:#108EE9;
				margin-bottom: 20upx;
				width:90%;
				padding:20upx;
				text-align: center;
				margin:0 auto;
				color:white;
				margin-top:40upx;
				margin-bottom:20upx;
				border-radius: 10upx;
			}
		}

	}
	
</style>